@extends('huweize.layouts.userHome')
@section('title','作品管理-阅文作家专区')
@section('main')
    <div class="col-md-12 workHeader">
        <h3>作品管理</h3>
    </div>
    <div class="row">
    <div class="col-md-12 workCreat">
        <a href="{{url('huweize/writer/book/add')}}" class="btn btn-info workCreat_right">
            <span class="glyphicon glyphicon-plus"></span>
            创建作品
        </a>
    </div>
    </div>
    <div class="row">
        @section('center')
            <div class="table-responsive" style="margin-right: -17px;">
            <table class="table table-striped table-hover">
                <tr>
                    <th>书名</th>
                    <th>封面</th>
                    <th>分类</th>
                    <th>章节数</th>
                    <th>最近更新时间</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                @foreach($jg as $k)
                <tr>
                    <td>{{$k->bookname}}</td>
                    <td>
                        @if($k->bookicon)
                            <img src="{{asset('image/books/'.$k->bookicon)}}" alt="" style="height:100px;width:100px">
                        @else
                            <img src="{{asset('image/public.jpg')}}" alt="" style="height:100px;width:100px">
                        @endif
                    </td>
                    <td>
                        @if($k->cid==1)
                            玄幻
                        @elseif($k->cid==2)
                            科幻
                        @elseif($k->cid==3)
                            都市
                        @elseif($k->cid==4)
                            军事
                        @elseif($k->cid==5)
                            末日
                        @elseif($k->cid==6)
                            武侠
                        @elseif($k->cid==7)
                            爱情
                        @endif
                    </td>
                    <td>
                        {{$k->chapterssum}}
                    </td>
                    <td>
                        {{date('Y-m-d',$k->uptime)}}
                    </td>
                    <td>
                        {{date('Y-m-d',$k->addtime)}}
                    </td>
                    <td>
                        <a href="{{url('huweize/writer/updatabook/'.$k->id)}}">修改书籍</a>&nbsp;  <a href="{{url('huweize/writer/book/chapters/'.$k->id)}}">更新章节</a> &nbsp;<a href="{{url('huweize/writer/book/deletebook/'.$k->id)}}">删除</a>
                    </td>
                </tr>

                @endforeach
                <script>
                    (function(){
                        $.ajax({

                        })
                    })()
                </script>
            </table>
                {{$jg->links()}}
            </div>
        @show
    </div>


@endsection